﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace IBLL
{
    public interface IBaseService<T> where T : class, new()
    {
        Task<T> AddAsync(T entity);
        Task<T> UpdateAsync(T entity);
        Task<bool> DeleteAsync(T entity);
        Task<T> GetModelAsync(Expression<Func<T, bool>> whereLambda);
        Task<IList<T>> GetListAsync(Expression<Func<T, bool>> whereLambda);
        Task<Tuple<IList<T>, int>> GetPageAsync<TS>(int pageSize, int pageIndex, Expression<Func<T, bool>> whereLambda, Expression<Func<T, TS>> orderByLambda, bool isAsc);
    }
}
